package com.zxm.util;

import java.util.ArrayList;
import java.util.List;

public class StringUtils {

	/**
	 * 将String类型的数组，转化为list<Integer>
	 */
	public static List<Integer> arr2List(String str){
		List<Integer> resList = new ArrayList<>();
		String[] arr = str.split(",");
		if(str!=null && str.length()>0) {
			for(String s:arr) {
				resList.add(Integer.parseInt(s));
			}
		}
		return resList;
	}
	
	/**
	 * 将String类型的数组，转化为list<Long>
	 */
	public static List<Long> arr2ListLong(String str){
		List<Long> resList = new ArrayList<>();
		String[] arr = str.split(",");
		if(str!=null && str.length()>0) {
			for(String s:arr) {
				resList.add(Long.parseLong(s));
			}
		}
		return resList;
	}
}
